// pages/switchpage/switchpage.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        temperature: "体温",
        oxygenerator: "制氧",
        oximeter: "血氧",
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {

    },


    temperature: function () {
        console.log(this.data.temperature);
        if (wx.getStorageSync('deviceId')) {
            wx.navigateTo({
                url: '../operation/operation'
            });
        } else if (wx.getStorageSync('isRead')) {
            wx.navigateTo({
                url: '../connection/connection?name=' + this.data.temperature,
            });
        }
        // wx.navigateTo({
        //     url: '../operation/operation'
        // });
    },
    oximeter: function () {
        if (wx.getStorageSync('oximeterDeviceId')) {
            wx.navigateTo({
                url: '../oximeter/oximeter'
            });
        } else if (wx.getStorageSync('isRead')) {
            wx.navigateTo({
                url: '../connection/connection?name=' + this.data.oximeter,
            });
        }
            // wx.navigateTo({
            //     url: '../oximeter/oximeter'
            // });
    },
    oxygenerator: function () {
        console.log(3);
    },
})